package com.office.file.permission.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.office.file.permission.mapper.FilePermissionMapper;
import com.office.file.permission.domain.FilePermission;
import com.office.file.permission.service.IFilePermissionService;

/**
 * 文档权限Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-23
 */
@Service
public class FilePermissionServiceImpl implements IFilePermissionService 
{
    @Autowired
    private FilePermissionMapper filePermissionMapper;

    /**
     * 查询文档权限
     * 
     * @param permissionId 文档权限主键
     * @return 文档权限
     */
    @Override
    public FilePermission selectFilePermissionByPermissionId(Long permissionId)
    {
        return filePermissionMapper.selectFilePermissionByPermissionId(permissionId);
    }

    /**
     * 查询文档权限列表
     * 
     * @param filePermission 文档权限
     * @return 文档权限
     */
    @Override
    public List<FilePermission> selectFilePermissionList(FilePermission filePermission)
    {
        return filePermissionMapper.selectFilePermissionList(filePermission);
    }

    /**
     * 新增文档权限
     * 
     * @param filePermission 文档权限
     * @return 结果
     */
    @Override
    public int insertFilePermission(FilePermission filePermission)
    {
        return filePermissionMapper.insertFilePermission(filePermission);
    }

    /**
     * 修改文档权限
     * 
     * @param filePermission 文档权限
     * @return 结果
     */
    @Override
    public int updateFilePermission(FilePermission filePermission)
    {
        return filePermissionMapper.updateFilePermission(filePermission);
    }

    /**
     * 批量删除文档权限
     * 
     * @param permissionIds 需要删除的文档权限主键
     * @return 结果
     */
    @Override
    public int deleteFilePermissionByPermissionIds(Long[] permissionIds)
    {
        return filePermissionMapper.deleteFilePermissionByPermissionIds(permissionIds);
    }

    /**
     * 删除文档权限信息
     * 
     * @param permissionId 文档权限主键
     * @return 结果
     */
    @Override
    public int deleteFilePermissionByPermissionId(Long permissionId)
    {
        return filePermissionMapper.deleteFilePermissionByPermissionId(permissionId);
    }
}
